<template>
  <div id="app">
    <Header v-show="!isHezuo"></Header>
    <router-view/>
    <Footer v-show="!isHezuo"></Footer>
  </div>
</template>

<script>
import Header from "@components/header";
import Footer from "@components/footer";

export default {
  data() {
    return {
      isHezuo:false
    }
  },
  components: {
    Header,
    Footer,
  },
  watch: {
    $route(to,from) {
    //  console.log(to)
     if(to.name == "hezuo"){
       this.isHezuo = true
      //  if(from.name == "hezuo"){
      //    this.$router.resolve({
      //     path: "/hezuo",
      //     query: to.query
      //   });
      //  }else{
      //     this.$router.go(-1);
      //     let routeData = this.$router.resolve({
      //       path: "/hezuo",
      //       query: to.query
      //     });
      //     window.open(routeData.href, '_blank');
      //  }
     }else
     if(to.name == "hezuoGr"){
       this.isHezuo = true
      //  if(from.name == "hezuoGr"){
      //    this.$router.resolve({
      //     path: "/hezuoGr",
      //     query: to.query
      //   });
      //  }else{
      //     this.$router.go(-1);
      //     let routeData = this.$router.resolve({
      //       path: "/hezuoGr",
      //       query: to.query
      //     });
      //     window.open(routeData.href, '_blank');
      //  }
     }else{
       this.isHezuo = false
     }
    }
  }
}
</script>

<style lang="stylus">
#app
  font-family Avenir, Helvetica, Arial, sans-serif
  -webkit-font-smoothing antialiased
  -moz-osx-font-smoothing grayscale
</style>
